<?php


use Phinx\Seed\AbstractSeed;

class AdminUserSeeder extends AbstractSeed
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * https://book.cakephp.org/phinx/0/en/seeding.html
     */
    public function run (): void {
        $data = [
            [
                'username'    => 'admin',
                'mobile'      => '',
                'gender'      => 1,
                'avatar'      => '',
                'password'    => password_hash('888888', PASSWORD_BCRYPT),
                'full_name'   => '超级管理员',
                'post_name'   => '',
                'status'      => 1,
                'create_time' => date('Y-m-d H:i:s'),
                'update_time' => date('Y-m-d H:i:s')
            ]
        ];
        $table = $this->table('admin_user');
        $table->truncate();
        $table->insert($data)->save();
    }
}
